﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TienLen
{
    /// <summary>
    /// A modal form that can be used to get a value.
    /// </summary>
    public partial class ChangeValue : Form
    {
        public ChangeValue(ChangeValueType valuechange, string value)
        {
            InitializeComponent();

            // Display the information, depending on what value the arguments have given
            if (valuechange == ChangeValueType.Name)
            {
                this.Text = "Change Name";
                txtInfo.Text = "Change Name To:";
            }
            else if (valuechange == ChangeValueType.PersonalMsg)
            {
                this.Text = "Change Personal Message";
                txtInfo.Text = "Change Personal Message To:";
            }

            // Set value to the textbox.
            this.value.Text = value;
        }

        /// <summary>
        /// The returning value.
        /// </summary>
        public String Value
        {
            get { return value.Text; }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
    }
}
